package com.situ.ssm.controller;

import java.util.List;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.situ.ssm.entity.Banji;
import com.situ.ssm.service.IBanjiService;
import com.situ.ssm.service.impl.BanjiServiceImpl;

@RequestMapping(value="/banji")
@Controller
public class BanjiController {
	private IBanjiService banjiService = new BanjiServiceImpl(); 
	
	//一对多查询
	/*根据班级id，查询该班级下所有的学生*/
	@RequestMapping(value="/findBanjiInfoById")
	@ResponseBody
	public Banji findBanjiInfoById(Integer id) {
		return banjiService.findBanjiInfoById(id);
	}
	
	//一对多，不输入id全部查出，输入id查出id班级的人
	@RequestMapping(value="findBanji")
	@ResponseBody
	public List<Banji> findBanji(Integer id) {
		return banjiService.findBanji(id);
	}

	//多对多查询
	/*查询多个班级的多个课程*/
	@RequestMapping(value="findBanjiCourseinfo")
	@ResponseBody
	public List<Banji> findBanjiCourseinfo(){
		return banjiService.findBanjiCourseinfo();
	}
}
